package com.skyk.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.skyk.pojo.dto.UserAddDTO;
import com.skyk.pojo.dto.UserDTO;
import com.skyk.pojo.dto.UserLoginDTO;
import com.skyk.pojo.entity.User;
import com.baomidou.mybatisplus.extension.service.IService;
import com.skyk.util.Result;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/**
 * @author 86147
 * @description 针对表【user】的数据库操作Service
 * @createDate 2024-11-27 17:31:14
 */
public interface UserService extends IService<User> {

    /*登录业务逻辑*/
    String loginService(UserLoginDTO userLoginDTO);

    /*分页查询*/
    IPage<UserDTO> getUsersPage(Page<User> page, String username, String gender, String phoneNumber);

    /*逻辑删除*/
    void logicDeleteUserById(Long id);

    /*启用或禁用用户*/
    void updateOrStop(Boolean state, Long id);

    /*新增用户*/
    Result addUser(UserAddDTO userAddDTO) throws RuntimeException;

    /*更新用户*/
    Result updateUser(Long id, UserAddDTO userAddDTO) throws RuntimeException;



    /*导出用户*/
    void exportUsers(HttpServletResponse response, String username, String gender, String phoneNumber) throws IOException;

    /**
     * 导出用户V2
     */
    void exportUsersV2(HttpServletResponse response, String username, String gender, String phoneNumber) throws IOException;

    /**
     * 导入用户
     */
    void importUsers(MultipartFile file) throws IOException;
}
